<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var provinces=["河南省","山东省","福建省"];
			var c1=["郑州市","商丘市","开封市"];
			var c2=["菏泽市","济南市","泰安市"];
			var c3=["泉州市","南平市","宁德市"];
			var city={["郑州市","商丘市","开封市"],c2,c3]};
			window.onload=function(){
				var pro=document.getElementsByName("province")[0];
				for(var i=0;i<provinces.length;i++){
					pro.options.add(new Option(provinces[i],provinces[i]));
				}
				var citys=document.getElementsByName("city")[0];
				for(var i=0;i<c1.length;i++){
					citys.options.add(new Option(c1[i],c1[i]));
				}
				pro.onchange=function(){
					var p=document.getElementById("province").selectedIndex;
					var c=document.getElementsByTagName("option");
					var ind=c[p].index;
					var cityss=city[ind];
					citys.options.length=0;
					for(var i=0;i<cityss.length;i++){
						citys.options.add(new Option(cityss[i],cityss[i]));
					}
				}
			}
			
		</script>
	</head>
	<body>
		省份：<select name="province" id="province"></select>
		市区：<select name="city" id="city"></select>
	</body>
</html>
